using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class StartMainButton : BasePanel
{
    [SerializeField] private Button startButton;
    [SerializeField] private Button loadDataButton;
    [SerializeField] private Button settingsButton;
    [SerializeField] private Button descriptionButton;
    [SerializeField] private Button exitButton;
    
    
    
    
    private void Start()
    {
        startButton.onClick.AddListener(StartButtonOnClick);
        loadDataButton.onClick.AddListener(LoadDataButtonOnClick);
        settingsButton.onClick.AddListener(SettingsButtonOnClick);
        descriptionButton.onClick.AddListener(DescriptionButtonOnClick);
        exitButton.onClick.AddListener(ExitButtonOnClick);
    }

    /// <summary>
    /// 开始游戏
    /// </summary>
    private void StartButtonOnClick()
    {
        UIManager.Instance.OpenPanel(UIConst.SETSAVEDATANAME);
    }
    
    //
    private void LoadDataButtonOnClick()
    {
        UIManager.Instance.OpenPanel(UIConst.LOADSAVEDATANAME);
    }

    /// <summary>
    /// 设置界面
    /// </summary>
    private void SettingsButtonOnClick()
    {
        UIManager.Instance.OpenPanel(UIConst.SETTING);
    }

    /// <summary>
    /// 打开说明界面
    /// </summary>
    private void DescriptionButtonOnClick()
    {
        UIManager.Instance.OpenPanel(UIConst.DESCRIPTION);
    }

    /// <summary>
    /// 退出游戏
    /// </summary>
    private void ExitButtonOnClick()
    {
        Application.Quit();
    }
}
